import datetime, time
#装饰器
def count_time(func):
	"""
	装饰器函数，计算函数调用用的时间
	param:函数
	"""
	def int_time(*args, **kwargs):
    	#程序开始时间
		start_time = datetime.datetime.now()  
		#调用函数
		result = func(*args, **kwargs)
		# 程序结束时间
		over_time = datetime.datetime.now()   
		# 函数运行消耗时间
		total_time = (over_time-start_time).total_seconds()
		print('程序共计%s秒' % total_time)
		return func(*args, **kwargs)
	return int_time


@count_time
def a_A(str1):
	"""
	把首字母不为大写的字符串首字母转为大写
	param:str
	"""
	if str1[0].islower:
		str2 = ''
		str2 = str2 + str1[0].upper()
		for i in range(1,len(str1)):
			str2 = str2 + str1[i]
		time.sleep(1)
		return str2
	else:
		time.sleep(2)
		return str1
			


name = ['lasd', 'Liha', 'sdsd', 'asosd']

for x in map(a_A, name):
	print(x)


